home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 5 / 005.d81 / diet program (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  4KB  |  188 lines

  1. 1 rem *** diet program
  2. 2 rem ***
  3. 3 rem *** by sandy davidson
  4. 4 rem ***
  5. 5 rem *** translated for the 64
  6. 6 rem ***
  7. 7 rem *** donna k. woody
  8. 9 poke783,peek(783)and254
  9. 10 printchr$(147):poke53281,1:poke53280,8:printchr$(144):poke53272,23
  10. 15 printchr$(8)
  11. 20 print:print:print
  12. 30 print:print:print
  13. 40 print"         [208]ress any key to begin"
  14. 50 print:print
  15. 60 print"    (or <*> to skip opening graphics)"
  16. 70 poke198,0:wait198,1:gete$
  17. 80 ife$="*"then530
  18. 100 printchr$(147)
  19. 120 fori=1to40:print"[129] ";:next
  20. 130 print:print
  21. 150 print"     [211][193][206][196][217] [196][193][214][201][196][211][207][206]'[211] [196][201][197][212] [208][210][207][199][210][193][205]     "
  22. 160 print
  23. 180 fori=1to40:print"[129] ";:next:print"[146][144]"
  24. 220 print
  25. 230 print
  26. 240 print"[212]his program is designed to help you"
  27. 250 print
  28. 260 print"calculate expected weight loss given"
  29. 270 print
  30. 280 print"certain factors."
  31. 290 print:print
  32. 320 print"[201]n addition, it can tell you the actual"
  33. 330 print
  34. 340 print"dates for each week of weight loss."
  35. 350 poke781,23:poke782,5:sys65520:print"[208]ress <[211][208][193][195][197][160][194][193][210]> to continue."
  36. 355 poke198,0:wait198,1:geta$:printchr$(147)
  37. 380 print"[202]ust type in your weight and other"
  38. 390 print
  39. 400 print"miscellaneous information."
  40. 420 print:print:print"[217]ou can change the data statments at"
  41. 430 print:print"the end of this program to provide"
  42. 440 print:print"yourself with motivation for"
  43. 450 print:print"successful dieting.":print:print
  44. 470 print"[217]ou could give yourself 'pep talks',"
  45. 480 print:print"or use them for specific goals you may"
  46. 490 print:print"have in mind."
  47. 500 poke781,23:poke782,5:sys65520:print"[208]ress <[211][208][193][195][197][160][194][193][210]> to continue.";
  48. 510 poke198,0:wait198,1:geta$:printchr$(147)
  49. 530 printchr$(147)
  50. 540 input"[215]hat's your name";n$
  51. 550 print:print
  52. 560 input"[208]resent weight: ";lb:lb$=str$(lb):lb$=right$(lb$,len(lb$)-1)
  53. 570 print:print
  54. 580 input"[195]alories/day you wish to eat: ";cal
  55. 590 print:print
  56. 600 print"[208]resent lifestyle:"
  57. 610 print"          1)  [211]edentary"
  58. 620 print"          2)  [205]oderate"
  59. 630 print"          3)  [193]ctive"
  60. 640 print
  61. 650 poke781,16:poke782,0:sys65520:input"[195]hoose 1, 2, or 3: ";z
  62. 660 ifz=1thene=16:goto700
  63. 670 ifz=2thene=17:goto700
  64. 680 ifz=3thene=18:goto700
  65. 690 goto650
  66. 700 printchr$(147)
  67. 710 input"[206]umber of weeks you wish to diet: ";w
  68. 720 print:print
  69. 730 input"[205]onth (use the form [216][216]): ";m:m$=str$(m):m$=right$(m$,2)
  70. 740 print:print
  71. 750 input"[196]ay (use the form [216][216]): ";d:d$=str$(d):d$=right$(d$,2)
  72. 760 print:print
  73. 770 input"[217]ear (use the form [216][216]): ";y:y$=str$(y):y$=right$(y$,2)
  74. 780 ifn$=""thenn$="[207]"
  75. 840 print:print
  76. 850 print"[196]o you wish to have this printed out?[160]";
  77. 860 poke198,0:wait198,1:geta$
  78. 870 ifa$="n"ora$="[206]"thenprintchr$(147):goto900
  79. 872 print:print"[208]lease turn printer on and press a key."
  80. 874 poke198,0:wait198,1:getk$
  81. 876 open4,4,7:cmd4
  82. 900 readv$:ifv$="[197][206][196]"then restore:readv$:goto900
  83. 910 ifn$="[207]"thenprintspc(13)"[196][201][197][212][160][208][210][207][199][210][193][205]":goto970
  84. 915 t=int((40-(len(n$)+15))/2)
  85. 920 printtab(t)n$;"'[211] [196][201][197][212][160][208][210][207][199][210][193][205]"
  86. 970 print:c=0
  87. 980 print"   [196]ate    [215]t.   [196]iet [212]hought for [212]oday"
  88. 990 print"---------------------------------------"
  89. 1010 print
  90. 1020 printm$;"-";d$;"-";y$;
  91. 1030 printspc(3)lb$;
  92. 1040 printspc(3)v$:c=c+1
  93. 1060 fori=1tow
  94. 1070 readv$:ifv$="[197][206][196]"thenrestore:readv$:goto1070
  95. 1080 ifm=1thenn=31
  96. 1090 ifm=2thenn=28
  97. 1100 ifm=3thenn=31
  98. 1110 ifm=4thenn=30
  99. 1120 ifm=5thenn=31
  100. 1130 ifm=6thenn=30
  101. 1140 ifm=7thenn=31
  102. 1150 ifm=8thenn=31
  103. 1160 ifm=9thenn=30
  104. 1170 ifm=10thenn=31
  105. 1180 ifm=11thenn=30
  106. 1190 ifm=12thenn=31
  107. 1200 d=d+7
  108. 1210 ifd>nthenm=m+1
  109. 1220 ifd>nthend=d-n
  110. 1230 ifm>12theny=y+1
  111. 1240 ifm>12thenm=m-12
  112. 1245 d$=str$(d):d$=right$(d$,2)
  113. 1246 m$=str$(m):m$=right$(m$,2)
  114. 1247 y$=str$(y):y$=right$(y$,2)
  115. 1250 lb=lb-(((lb*e*7)-cal*7)/3500):lb=int(lb+.5)
  116. 1255 lb$=str$(lb):lb$=right$(lb$,len(lb$)-1)
  117. 1260 printm$"-"d$"-"y$;spc(3);
  118. 1270 printlb$;
  119. 1280 printspc(3);
  120. 1290 printv$:c=c+1
  121. 1292 c1=c/14:ifc1=int(c/14)and(a$="n"ora$="[206]")thengosub2000
  122. 1310 next
  123. 1320 ife=16thene$="[211]edentary"
  124. 1330 ife=17thene$="[205]oderate"
  125. 1340 ife=18thene$="[193]ctive"
  126. 1350 print:print:print"[217]ou will weigh ";lb$" by "m$"-"d$"-"y$
  127. 1360 print"if you eat ";cal;" calories a day and"
  128. 1370 print"maintain a";:ife=18thenprint"n";
  129. 1375 print" "e$" lifestyle."
  130. 1380 ifa$="y"ora$="[217]"thenprint#4:close4
  131. 1390 poke781,23:poke782,6:sys65520:print"[208]ress <[211][208][193][195][197][160][194][193][210]> to continue."
  132. 1395 poke198,0:wait198,1:getz$
  133. 1396 printchr$(147)
  134. 1397 goto63000
  135. 1400 data"[212]oday's the first day!"
  136. 1410 data"[217]ou'll feel better!"
  137. 1420 data"[217]ou can do it!"
  138. 1430 data"[217]ou'll look great!"
  139. 1440 data"[197][206][196]"
  140. 1450 data
  141. 1460 data
  142. 1470 data
  143. 1480 data
  144. 1490 data
  145. 1500 data
  146. 1510 data
  147. 1520 data
  148. 1530 data
  149. 1540 data
  150. 1550 data
  151. 1560 data
  152. 1570 data
  153. 1580 data
  154. 1590 data
  155. 1600 data
  156. 1610 data
  157. 1620 data
  158. 1630 data
  159. 1640 data
  160. 1650 data
  161. 1660 data
  162. 1670 data
  163. 1680 data
  164. 1690 data
  165. 1700 data
  166. 1710 data
  167. 1720 data
  168. 1730 data
  169. 1740 data
  170. 1750 data
  171. 1760 data"[197][206][196]"
  172. 2000 poke781,23:poke782,6:sys65520:print"[208]ress <[211][208][193][195][197][160][194][193][210]> to continue.";
  173. 2001 poke198,0:wait198,1:getz$
  174. 2002 printchr$(147)
  175. 2005 ifn$="[207]"thenprintspc(13)"[196][201][197][212][160][208][210][207][199][210][193][205]":goto2030
  176. 2010 t=int((40-(len(n$)+15))/2)
  177. 2020 printspc(t)n$;"'[211] [196][201][197][212][160][208][210][207][199][210][193][205]"
  178. 2030 print
  179. 2040 print"   [196]ate    [215]t.   [196]iet [212]hought for [212]oday"
  180. 2050 print"---------------------------------------"
  181. 2060 print
  182. 2070 return
  183. 63000 print"[147][215]ould you like to try again?"
  184. 63005 poke198,0:wait198,1:getk$:ifk$<>"y"andk$<>"n"then63005
  185. 63010 ifk$="y"thenrestore:goto530
  186. 63020 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
  187. 63030 poke631,13:poke632,13:poke198,2:end
  188.